import {
  computed,
  onMounted,
} from 'vue'
import store from '../store/store.js'

export function setTabbarBadge () {
  const count = computed(() => store.getters['m_cart/addedCount'])
  onMounted(() => {
    setBadge();
  });

  function setBadge() {
    uni.setTabBarBadge({
      index:2,
      text:count.value+''
    })
  }
}